/*
 * Valor.java
 *
 * Created on 8 de julio de 2007, 18:51
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package poker;


/**
 *
 * @author jose
 */
public class Valor {
    public int jugada = 0;
    int c1 = 0;
    int c2 = 0;
    int c3 = 0;
    int c4 = 0;
    int c5 = 0;
    
    /** Creates a new instance of Valor */
    public Valor() {
        jugada = 0;
        c1 = 0;
        c2 = 0;
        c3 = 0;
        c4 = 0;
        c5 = 0;
     
    }
     
     public boolean iguales(Valor v2){
         if((v2.jugada == this.jugada) && 
            (v2.c1 == this.c1) &&
            (v2.c2 == this.c2) &&
            (v2.c3 == this.c3) &&
            (v2.c4 == this.c4) &&
            (v2.c5 == this.c5)) return true;
         return false;
     }
    
     public boolean comparar(Valor v2)
     {
         if (v2.jugada > this.jugada) return false;
         else if (v2.jugada < this.jugada) return true;
         if (v2.c1 > this.c1) return false;
         else if (v2.c1 < this.c1) return true;
         if (v2.c2 > this.c2) return false;         
         else if (v2.c2 < this.c2) return true;
         if (v2.c3 > this.c3) return false;         
         else if (v2.c3 < this.c3) return true;
         if (v2.c4 > this.c4) return false;         
         else if (v2.c4 < this.c4) return true;
         if (v2.c5 > this.c5) return false;         
         else if (v2.c5 < this.c5) return true;
         return true;
         
     }
    public void setValor(int jugada,int c1,int c2,int c3, int c4,int c5)
    {
        this.jugada = jugada;
        this.c1 = c1;
        this.c2 = c2;
        this.c3 = c3;
        this.c4 = c4;
        this.c5 = c5;
    }
    public void setValor1(int c1){
        this.c1 = c1;
    }
    
    public void setValor3(int c3){
        this.c3 = c3;
    }
    
    public int getValor1()
    {
        return c1;
    }
    
    
    public int getValor2()
    {
        return c2;
    }
    
    
    public int getValor3()
    {
        return c3;
    }
    
    public String toString2()
    {
        String a = (jugada +" :"+c1 +" "+c2+" "+c3+" "+c4+" "+c5);
        return a;
    }
    
   public int toInt(){
        try{
            
            int a1=0;
            a1 = c5;
            a1 = a1 + c4 * 16;
            a1 = a1 + c3 * 16 * 16;
            a1 = a1 + c2 * 16 * 16 * 16;
            a1 = a1 + c1 * 16 * 16 * 16 * 16;
            a1 = a1 + jugada * 18 * 16 * 16 * 16 * 16;
            return a1;
        }
        catch (Exception ex){
            return 0;
        }
    }

    public int compare(Object o1, Object o2) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
